﻿using System;
using System.Net.Mail;

namespace DotNetNexusSpam.SpamFilter
{
    class BlankFromAddressFilter : FilterBase   
    {
        public BlankFromAddressFilter(CDOMessageWrapper email, string startupPath)
            : base(email, startupPath)
        {
            base.Name = "Blank from address";
        }

        public override void Fire()
        {
            base.ActionToTake = FilterAction.PROCESS_NORMALLY;
            base.IsSpam = false;

            if (Email.CDOMessage.From == "")
            {
                base.ActionToTake = FilterAction.DELETE_EMAIL;
                base.IsSpam = true;
            }
        }

        public override void LoadConfiguration()
        {
            // nothing to load
        }
    }
}
